package com.fb.test;

import com.facebook.android.DialogError;
import com.facebook.android.Facebook;
import com.facebook.android.FacebookError;
import com.facebook.android.Facebook.DialogListener;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class FBTestActivity extends Activity {
	private final String APP_ID = "167438593348176";
	private final String TAG = "FaceBookApp";

	Facebook fb = new Facebook(APP_ID);
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        fb.authorize(this, new DialogListener() {

			@Override
			public void onCancel() {
				Log.d(TAG, "Cancelled");
			}

			@Override
			public void onComplete(Bundle values) {
				Log.d(TAG, "Completed");

				wronldkafjodi
			}

			@Override
			public void onError(DialogError e) {
				Log.e(TAG, "Error", e);
			}

			@Override
			public void onFacebookError(FacebookError e) {
				Log.e(TAG, "Facebook Error", e);
			}
        	
        });
    }
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		
		fb.authorizeCallback(requestCode, resultCode, data);
	}
}
